        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Matcher abstract class / matcher Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="matcher" data-type="Matcher">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../matcher.html">matcher</a> &rsaquo; <a href="../matcher/Matcher.html">Matcher</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Matcher</strong>
          abstract class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<p><a class="crossref" href="../matcher.html#expect">expect</a> Matchers must implement the Matcher class.
The base Matcher class that implements this interface has
a generic implementation of <a class="crossref" href="../matcher/Matcher.html#describeMismatch">describeMismatch</a> so this does
not need to be provided unless a more clear description is
required. The other two methods (<a class="crossref" href="../matcher/Matcher.html#matches">matches</a> and <a class="crossref" href="../matcher/Matcher.html#describe">describe</a>)
must always be provided as they are highly matcher-specific.</p>
<pre class="source">
abstract class Matcher {
 /**
  * This does the matching of the actual vs expected values.
  * [item] is the actual value. [matchState] can be supplied
  * and may be used to add details about the mismatch that are too
  * costly to determine in [describeMismatch].
  */
 bool matches(item, MatchState matchState);

 /** This builds a textual description of the matcher. */
 Description describe(Description description);

 /**
  * This builds a textual description of a specific mismatch. [item]
  * is the value that was tested by [matches]; [matchState] is
  * the [MatchState] that was passed to and supplemented by [matches]
  * with additional information about the mismact, and [mismatchDescription]
  * is the [Description] that is being built to decribe the mismatch.
  * A few matchers make use of the [verbose] flag to provide detailed
  * information that is not typically included but can be of help in
  * diagnosing failures, such as stack traces.
  */
 Description describeMismatch(item, Description mismatchDescription,
     MatchState matchState, bool verbose);
}
</pre>
</div>
<h3>Subclasses</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../matcher/BaseMatcher.html">BaseMatcher</a></span></p>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="describe">
abstract <a href="../matcher/Description.html">Description</a> <strong>describe</strong>(<a href="../matcher/Description.html">Description</a> description) <a class="anchor-link" href="#describe"
              title="Permalink to Matcher.describe">#</a></h4>
<div class="doc">
<p>This builds a textual description of the matcher. </p>
</div>
</div>
<div class="method"><h4 id="describeMismatch">
abstract <a href="../matcher/Description.html">Description</a> <strong>describeMismatch</strong>(item, <a href="../matcher/Description.html">Description</a> mismatchDescription, <a href="../matcher/MatchState.html">MatchState</a> matchState, bool verbose) <a class="anchor-link" href="#describeMismatch"
              title="Permalink to Matcher.describeMismatch">#</a></h4>
<div class="doc">
<p>This builds a textual description of a specific mismatch. 
<span class="param">item</span>
is the value that was tested by <a class="crossref" href="../matcher/Matcher.html#matches">matches</a>; 
<span class="param">matchState</span> is
the <a class="crossref" href="../matcher/MatchState.html">MatchState</a> that was passed to and supplemented by <a class="crossref" href="../matcher/Matcher.html#matches">matches</a>
with additional information about the mismact, and 
<span class="param">mismatchDescription</span>
is the <a class="crossref" href="../matcher/Description.html">Description</a> that is being built to decribe the mismatch.
A few matchers make use of the 
<span class="param">verbose</span> flag to provide detailed
information that is not typically included but can be of help in
diagnosing failures, such as stack traces.</p>
</div>
</div>
<div class="method"><h4 id="matches">
abstract bool <strong>matches</strong>(item, <a href="../matcher/MatchState.html">MatchState</a> matchState) <a class="anchor-link" href="#matches"
              title="Permalink to Matcher.matches">#</a></h4>
<div class="doc">
<p>This does the matching of the actual vs expected values.

<span class="param">item</span> is the actual value. 
<span class="param">matchState</span> can be supplied
and may be used to add details about the mismatch that are too
costly to determine in <a class="crossref" href="../matcher/Matcher.html#describeMismatch">describeMismatch</a>.</p>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
